package com.itheima.练习.test7;

import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;
//BS中，客户端就是浏览器，服务端就是接收传输，回写也是写给浏览器

//先运行service，再浏览器输入127.0.0.1:端口号就可以得到数据
public class Server {
    public static void main(String[] args) throws IOException {

        ServerSocket ss=new ServerSocket(10000);


        Socket socket = ss.accept();
        InputStream is = socket.getInputStream();

        int b=0;
        while ((b=is.read())!=-1){
            System.out.print((char)b);
        }
        socket.close();
        ss.close();
    }
}
